<template>
    <div>
        <div>
            <span>发票号</span>
            <el-input type="text" v-model="invoiceNumber"  placeholder="发票号" size="mini" style="width: 20%"></el-input>
            <el-button type="primary" size="mini">挂号</el-button>
            <el-button type="primary" size="mini">清空</el-button>
        </div>
        <div>挂号信息</div>
        <div>
            <span>病历号：</span>
            <el-input size="mini" v-model="caseNum" style="width: 10%"></el-input>
            <span>姓名：</span>
            <el-input size="mini" v-model="user.name" style="width: 10%" placeholder="输入姓名"></el-input>
            <span>性别</span>
            <el-select v-model="sexChoosed" placeholder="请选择" size="mini">
            <el-option
                    v-for="item in sex"
                    :key="item.id"
                    :label="item.constantname"
                    :value="item.id">
            </el-option>
            </el-select>
            <span>年龄</span>
            <el-input type="text" v-model="conlandChoose" size="mini" style="width: 10%" placeholder="输入年龄"></el-input>
            <el-select v-model="bothDateChoosed" placeholder="请选择" size="mini">
                <el-option
                        v-for="item in bothDate"
                        :key="item.value"
                        :label="item.label"
                        :value="item.value">
                </el-option>
            </el-select>
        </div>
        <div>
            <span class="demonstration" >出生日期</span>
            <el-date-picker
                    size="mini"
                    v-model="conlandChoose"
                    type="date"
                    placeholder="选择日期">
            </el-date-picker>
            <span>身份证号</span>
            <el-input type="text" size="mini" placeholder="在次输入身份证号" style="width: 20%"></el-input>
            <span>家庭住址</span>
            <el-input type="text" size="mini" placeholder="在次输入家庭住址" style="width: 20%"></el-input>
        </div>
        <div>
            <span>结算类别</span>
            <el-select v-model="costChoosed" placeholder="请选择" size="mini">
                <el-option
                        v-for="item in cost"
                        :key="item.value"
                        :label="item.label"
                        :value="item.value">
                </el-option>
            </el-select>
            <span>看诊日期</span>
            <el-date-picker
                    size="mini"
                    v-model="seeDoctorDate"
                    type="date"
                    placeholder="选择日期">
            </el-date-picker>
            <span>午别</span>
            <el-select v-model="nooneachChoosed" placeholder="请选择" size="mini">
                <el-option
                        v-for="item in nooneach"
                        :key="item.value"
                        :label="item.label"
                        :value="item.value">
                </el-option>
            </el-select>
            <span>挂号科室</span>
            <el-select v-model="departmentChoosed" placeholder="请选择" size="mini">
                <el-option
                        v-for="item in department"
                        :key="item.value"
                        :label="item.label"
                        :value="item.value">
                </el-option>
            </el-select>
        </div>
        <div>
            <span>号别</span>
            <el-select v-model="numberChoosed" placeholder="请选择" size="mini">
                <el-option
                        v-for="item in number"
                        :key="item.value"
                        :label="item.label"
                        :value="item.value">
                </el-option>
            </el-select>
            <span>看诊医生</span>
            <el-select v-model="HadFindDoctor" placeholder="请选择" size="mini">
                <el-option
                        v-for="item in findDoctor"
                        :key="item.value"
                        :label="item.label"
                        :value="item.value">
                </el-option>
            </el-select>
            <span>初始号额</span>
            <el-input type="text" size="mini" style="width: 20%" placeholder="初始号额"></el-input>
            <span>已用号额</span>
            <el-input type="text" size="mini" style="width: 20%" placeholder="已用号额"></el-input>
        </div>
        <div>
            <span>病历本</span>
            <el-checkbox></el-checkbox>
            <span>应收金额</span>
            <el-input type="text" size="mini" style="width: 20%"></el-input>
            <span>收费方式</span>
            <el-select v-model="chargeChoosed" placeholder="请选择" size="mini">
                <el-option
                        v-for="item in chargeStyle"
                        :key="item.value"
                        :label="item.constantname"
                        :value="item.value">
                </el-option>
            </el-select>
        </div>


    </div>
</template>

<script>
    export default {
        name: "RegRegister",
        data(){
            return{
                user:{
                  name:"",
                },
                caseNum:'',//病例号
                invoiceNumber:'', //挂号号
                chargeStyle:[
                    {
                        value:'1',
                        label:'现金'
                    },
                    {
                        value:'1',
                        label:'刷卡'
                    }
                ],

                chargeChoosed:'',

                findDoctor:[
                    {
                        value:'1',
                        label:'扁鹊'
                    }
                ],

                HadFindDoctor:'',

                number:[
                    {
                        value:'1',
                        label:'好别'
                    },
                ],
                numberChoosed:"",

                department:[
                    {
                        value:'1',
                        label:'aaaa'
                    },
                    {
                        value:'1',
                        label:'bbbbb'
                    },
                ],
                departmentChoosed:'',

                nooneach:[
                    {
                        value:'1',
                        label:'上午'
                    },
                    {
                        value:'2',
                        label:'下午'
                    }
                ],

                nooneachChoosed:'',

                seeDoctorDate:'',

                cost:[
                    {
                        value:'1',
                        label:'自费'
                    },
                    {
                        value:'2',
                        label:'报销'
                    },
                ],
                costChoosed:'',

                conlandChoose:'',

                bothDate:[{
                    value:'1',
                    label:'岁'
                    },
                    {
                        value:'2',
                        label:'月'
                    },
                    {
                        value:'3',
                        label:'日'
                    },
                ],
                bothDateChoosed:'',

                sex:[],
                sexChoosed:'男'



            }
        },
        methods:{



            //初始化性别
            initSexChoose(){
                this.$getRequest("/reg/register/getSex").then(resp=>{
                    if (resp){
                        this.sex=resp;
                    }
                })
            },

            initCaseNum(){
              this.$getRequest("/reg/register/getCaseNum").then(resp=>{
                  if(resp){
                      this.caseNum=resp;
                      console.log(resp);
                  }
              })
            },
             initInvoice(){
                 this.$getRequest("/reg/register/getInvoiceNum").then(resp=>{
                     if (resp){
                         this.invoiceNumber=resp;
                     }
                 })

             }

        },
        mounted() {
            this.initInvoice();
            this.initCaseNum();
            this.initSexChoose();
        }
    }
</script>

<style scoped>

</style>